package com.example.shop.fgo.entity;

import java.util.ArrayList;
import java.util.List;

/**
 * Created by Administrator on 2017/3/1.
 */

public class PhotoItem {

    private int type;


    public static final int TYPE_TIME=0;
    private String time;



    public static final int TYPE_DATA_COUNT_1=1;
    public static final int TYPE_DATA_COUNT_2=2;
    public static final int TYPE_DATA_COUNT_3=3;
    private List<FileListEntity.DataEntity> mDataEntities;


    public int getType() {
        return type;
    }

    public List<FileListEntity.DataEntity> getDataEntities() {
        return mDataEntities;
    }
    public void addDataEntity(FileListEntity.DataEntity dataEntity) {
        if (mDataEntities == null) {
            mDataEntities=new ArrayList<>();
        }

        mDataEntities.add(dataEntity);

        //        switch (mDataEntities.size()) {
//            case 1:
//                this.type=TYPE_DATA_COUNT_1;
//                break;
//            case 2:
//                this.type=TYPE_DATA_COUNT_2;
//                break;
//            case 3:
//                this.type=TYPE_DATA_COUNT_3;
//                break;
//        }
        this.type=mDataEntities.size();

    }

    public String getTime() {
        return time;
    }

    public void setTime(String time) {
        this.type=TYPE_TIME;
        this.time = time;
    }

    public boolean isFull(){
        if (mDataEntities == null) {
            mDataEntities=new ArrayList<>();
        }
        return mDataEntities.size()>=3;
    }

    @Override
    public String toString() {

        if (type==TYPE_TIME){
            return time;
        }else {
            return mDataEntities.size()+"";
        }
    }
}
